#include <stdio.h>
#include <string.h>

int Chinese_split(char * s_ , int num)
{
    char buf[128];
    strcpy(buf , s_);
    int buf_len = strlen(buf);      // 字符串字符数值
    int ch_num = (buf_len / 3) - 1; // 字符串中文个数 -1 
    char * ptr = &buf[buf_len - 1]; // 指向字符串的末尾

    int car_num = (ch_num + 1) / num + 1;                // 
    int word_num = num;// 每列使用多少个中文

    for (size_t j = 0; j < ch_num; j++)
    {
        for (size_t k = 0; k < 3; k++)
        {
            for (size_t i = 0; i < ch_num - j; i++)
            {
                ptr[i+1] = ptr[i];
            }
            ptr--;
        }
    }
    for (size_t i = 1; i <= ch_num; i++)
    {
        buf[(4 * i) - 1] = '\0';
    }
    
    ptr = buf;

    for (size_t i = 1; i < car_num; i++)
    {
        for (size_t j = 0; j < word_num; j++)
        {
            printf("%s" , ptr);
            ptr += 8;
        }
        printf("\n");
        ptr = buf;
        ptr += ((4 * i));
    }
    
    return 0;
}

int main(int argc, char const *argv[])
{
    char buf[128] = "赵三钱四孙五李六王";
    Chinese_split( buf , 4);
}

/*
列等于  列
行等于  字数 / 列数

判断 列 % 字数 == 0

*/

